/*
 * CharlieplexingLed.h
 *
 *  Created on: Jan 2, 2025
 *      Author: luoxing
 */

#ifndef USER_CHARLIEPLEXINGLED_H_
#define USER_CHARLIEPLEXINGLED_H_

#include "ch32v00x.h"
#include "stdio.h"

typedef struct {
    uint8_t pin;
    uint8_t status;
    GPIO_TypeDef *gpio_port_high;
    uint16_t gpio_pin_high;
    GPIO_TypeDef *gpio_port_low;
    uint16_t gpio_pin_low;
} CharlieplexingLed_t;


void CharlieplexingLed_init(void);
uint8_t CharlieplexingLedGetSize(void);
int8_t CharlieplexingLed_read_pin(uint8_t pin);
int8_t CharlieplexingLed_write_pin(uint8_t pin, uint8_t status);
void CharlieplexingLed_update(CharlieplexingLed_t *CharlieplexingLed);

#endif /* USER_CHARLIEPLEXINGLED_H_ */
